package com.wkbb.common.enums;

/**
 * 请假审批枚举
 * 状态（0：未审核  1：通过  2：不通过 3撤回 4取消 5失效）
 */
public enum LeaveStatusEnum {
    LEAVE_WAIT((short)0, "未审核"),
    LEAVE_PASS((short)1, "通过"),
    LEAVE_NO_PASS((short)2, "不通过"),
    LEAVE_REVERT((short)3, "撤回"),
    LEAVE_CANCEL((short)4, "取消"),
    LEAVE_INVALID((short)5, "失效");

    private short code;
    private String desc;

    LeaveStatusEnum(short code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 普通方法
    public static String getDesc(short code) {
        for (LeaveStatusEnum c : LeaveStatusEnum.values()) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public short getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
